<?php
//微信支付后通知
class WePayHelper{
	
	//正确支付回调后，处理订单(支付单号、流水号、金额[分]、支付时间[20200414133525])、回调接口名字
	public static function Notify_UpdateOrder($payid,$liushui,$total_fee,$time_end,$action_name_en='wepay_do'){
		
		//发起后端回调吧

		$request = [
			'payid' => $payid,
			'payflowid' => $liushui,
			'payamount' => $total_fee,
			//'paytime' => $time_end,
			'paytime' => date('Y-m-d H:i:s',strtotime($time_end)),
		];

		__log(json_encode($request),'wepay_notify');

		$r = \ServerHelper::post($action_name_en,$request);
		__log(json_encode($r),'wepay_notify');

		$d = json_decode($r,true);
		return !empty($d['flag']);
		
		//return false; //必须 处理成功(支付成功)返回true，否则返回false
	}
	
}